#pragma once

#include "Base/Tests/Test.Application.h"

#undef  APP_NAME
#define APP_NAME	TestStorageSize
#undef  APP_BASE
#define APP_BASE	TestApp


class APP_NAME : public APP_BASE
{
public:
	APP_NAME (IPlatform *platform, EDevice::type deviceType) :
		APP_BASE( platform, deviceType )
	{
	}

	void Output (uni_c_string str)
	{
		ESS()->GetApplication()->GetPlatform()->ShowNotification( str.cstr(), true );
	}

	void OnEnter () override
	{
		uint64	ext_free = ESS()->GetFileSystem()->GetFreeSpace(
								ESS()->GetApplication()->GetPlatform()->GetDirectoryPath( EDirectory::EXTERNAL ) );
		uint64	ext_total = ESS()->GetFileSystem()->GetTotalSpace(
								ESS()->GetApplication()->GetPlatform()->GetDirectoryPath( EDirectory::EXTERNAL ) );


		uint64	int_free = ESS()->GetFileSystem()->GetFreeSpace(
								ESS()->GetApplication()->GetPlatform()->GetDirectoryPath( EDirectory::INTERNAL ) );
		uint64	int_total = ESS()->GetFileSystem()->GetTotalSpace(
								ESS()->GetApplication()->GetPlatform()->GetDirectoryPath( EDirectory::INTERNAL ) );

		Output( string("external free space: ") << TBytes<uint64>(ext_free).ToString() );
		Output( string("external total space: ") << TBytes<uint64>(ext_total).ToString() );

		Output( string("internal free space: ") << TBytes<uint64>(int_free).ToString() );
		Output( string("internal total space: ") << TBytes<uint64>(int_total).ToString() );
	}
};